﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using XDeal.BL.Implements;
using Utility;
using XDeal.Common.Web;
using XDeal.Common.Constants;
using XDeal.DAL.Entities;
using Utility.Enums;

namespace XDEALWEB.Controllers
{
    public class DistrictController : Controller
    {
        //
        // GET: /District/

        public ActionResult Index()
        {
            return View();
        }
   
        [HttpPost]
        public ActionResult DDLProvinceChange(int proviceID)
        {
            DistrictBL districtBL = new DistrictBL();
            List<District> listDistrict = districtBL.GetAllDistrictByProvinceID(proviceID);
            string result = string.Empty;

            foreach (District district in listDistrict)
            {
                result += "<option value='"+district.ID_i.ToString()+"'>"+district.DistrictName_s+"</option>";
            }

            return Content(result);
        }

    }
}
